<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>氿阳上位控制系统</title>
    <link rel="shortcut icon" th:href="@{/favicon_new.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/self/login/css/zui.css}" media="all">
    <link rel="stylesheet" type="text/css" th:href="@{/self/login/css/login.css}" media="all">
    <link th:href="@{/self/login/css/animate.min.css}" rel="stylesheet">
    <link th:href="@{/self/login/css/font-awesome.min.css}" rel="stylesheet">
    <script>if (window.top !== window.self) {
        window.top.location = window.location;
    }</script>
</head>

<body>
<div id="main-box" onkeydown="keyLogin(event);"></div>
<div id="main-content">
    <div class="login-body  animated fadeInLeft">
        <div id="app" class="login-main pr">
            <form action="javascript:;" method="post" class="login-form">
                <h3> 氿阳上位控制系统 </h3>
                <h5 style="padding-bottom: 10px"> RUCO  MAMES System </h5>
                <!-- 账号登陆 -->
                <div id="MobileBox" class="item-box">
                    <div class="input-group user-name"><span class="input-group-addon"><i class="icon-user"></i></span>
                        <input type="text" name="username" class="form-control" placeholder="请输入用户账号" v-model="account">
                    </div>
                    <div class="input-group password"><span class="input-group-addon"><i class="icon-lock"></i></span>
                        <input type="password" name="password" class="form-control" placeholder="请输入用户密码" v-model="password">
                    </div>
                    <div class="login_btn_panel">
                        <button class=" btn btn-primary btn-block btn-lg" data-ajax="post" type="submit"
                                data-callback="success" @click="login" id="btnLogin">登录
                        </button>
                        <div class="check-tips"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="pull-right" style="
                position:fixed; bottom:0; right:40%;">&copy; 技术支持: 睿控科技 &nbsp;&nbsp;联系电话：0510-85386917
    </div>
</div>

<!-- 全局js -->
<script th:src="@{/js/jquery.min.js}" type="text/javascript"></script>
<script th:src="@{/js/bootstrap.min.js}" type="text/javascript"></script>
<script th:src="@{/js/app.js}" type="text/javascript"></script>
<script th:src="@{/js/plugins/vue/vue.js}" type="text/javascript"></script>
<script th:src="@{/js/plugins/layer/layer.min.js}" type="text/javascript"></script>

<script type="text/javascript">
  $(function () {
            localStorage.removeItem("publicPath");
        var vue = new Vue({
            el: '#app',
            data: {
                account: "",
                password: ""
            },
            methods: {
                login: function () {
                    var data = this;
                    $.ajax({
                        url: baseUrl + "login",
                        type: "post",
                        dataType: "json",
                        contentType: "application/json",
                        data: JSON.stringify({account: data.account, password: data.password})
                    }).done(function (data) {
                        if (data.code === 0) {
                            location.href = "/jiuyang/view/index";
                        } else {
                            layer.msg(data.msg);
                        }
                    });
                }
            }
        });
    });

    function keyLogin() {
        if(event.keyCode === 13){
            document.getElementById("btnLogin").click();
        }
    }


</script>

</body>

</html>
